<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://ckeditor.com" prefix="ckeditor" %>
<%@page import="com.ckeditor.CKEditorConfig"%>
<%@page import="java.util.HashMap"%>
<%@page import="java.util.Map"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<%@ include file="/static/htm/head" %>
		<title>游戏论坛帖子专区</title>
	</head>
	<body style="font-size:15px;">
<div style="text-align: center;">
			<a href="index.jsp">
				<img alt="论坛Logo" height="56" src="static/pic/logo.jpg" width="192">
			</a>
		</div>
		<table width="100%">
			<tr>
				<td>
					<a href="postlist?id=${param.id }">
						返回帖子列表
					</a>
				</td>
				<td style="text-align: right;">
					<%@ include file="/static/htm/user.jsp" %>
				</td>
			</tr>
		</table>
		<c:if test="${bill ne null}">
		<form action="permit/buy" method="post"> 
			<input type="hidden" name="pid" value="${param.pid }">
			<input type="hidden" name="id" value= "${param.id }">
			<input type="hidden" name = "userId" value="${param.userId }">
			<table style="position:relative;width:60%;left:20%;">
				<tr>
					<td>商品名称</td>
					<td><input type="text" name="productname" value="${bill.pdesc }" disabled="disabled"></td>
				</tr>
				<tr>
					<td>
					价格
					</td>
					<td>
						<input type="text" name="price" value="${bill.total_fee / 100.0}" disabled="disabled"/>(商品价格单位是元，最多小数点后保存两位)
					</td>
				</tr>
				<tr>
					<td>
					卖方账户
					</td>
					<td>
						<input type="text" name="price" value="${bill.split_no}" disabled="disabled"/>(卖家收款账号)
					</td>
				</tr>
			<c:if test="${reason eq null }">
				<tr>
					<td>
						买方备注
					</td>
					<td>
						<input type="text" name="backup" value="" id="backup">(<font color="red">*</font>注明联系方式，如QQ、MSN、email、手机号)
					</td>
				</tr>
				<tr>
				<td  colspan="2">
					<div class="alert alert-error"  id="info">
					</div>
				</td>
				</tr>
				<tr>
					<td>
					</td>
					<td>
						<input type="submit" class="btn btn-success" value="去财付通支付" id="submit"><span style="margin-left: 15px;"><a href="readme" target="_blank">论坛平台交易准则</a></span>
					</td>
				</tr>
			</c:if>				
			</table>
		</c:if>
		<c:if test="${reason ne null }">
			<div class="alert alert-error" style="position:relative;width:60%;left:20%;" >
        		${reason }
      		</div>
		</c:if>
		</form>
		<%@ include file="/static/htm/foot.jsp" %>
	</body>
	<script type="text/javascript">
		$(document).ready(function(){
			$(document).ready(function(){
				function setInfo(info) {
					$("#info").html(info);
					$("#info").show();
				}
				function hideInfo() {
					$("#info").hide();
				}
				 hideInfo();
				$("#submit").click(function(){
					if($("#backup").val() == ""){
						setInfo("买家备注信息不正确");
						return false;
					} else {
						return true;
					}
						
				});
			});
		});
	</script>
</html>